import Taro from '@tarojs/taro';
import React, { createContext, useState, useCallback, useEffect } from 'react';

export type ProductTypes = {
    /** 标题 */
    title: string;
    /** 副标题 */
    subTitle: string;
    /** 图片路径 */
    imgUrl: string;
    /**价格 */
    price: string;
    /** 点击选项的回调 */
    onSelect?: (words: string) => void;
    /** 卡片类型 */
    classCard: 'willPay' | 'payed' | 'collection';
    /**payed类型卡片文字内容 */
    payedtext?: string;
    /**willPay类型卡片点击支付 */
    handlePay?: () => void;
    /**collection类型卡片是否被收藏 */
    isCollection?: boolean;
    /**collection类型卡片点击收藏 */
    handleChangeCollection?: () => void;
    /** 底部的按钮 */
    footRight?: React.ReactElement;
};

export const ProductCardContext = createContext<ProductTypes>(undefined);
